<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>Txt2tags User Guide</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
<LINK REL="Start" HREF="index.html">
<LINK REL="Contents" HREF="index.html">
<LINK REL="Prev" HREF="ConfigurationLoadingOrderandPrecedence.html">
<LINK REL="Next" HREF="includeconfcommand.html">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif }
H1 { font-family: sans-serif }
H2 { font-family: sans-serif }
H3 { font-family: sans-serif }
H4 { font-family: sans-serif }
H5 { font-family: sans-serif }
H6 { font-family: sans-serif }
SUB { font-size: smaller }
SUP { font-size: smaller }
PRE { font-family: monospace }
--></STYLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="userguide.css"></HEAD>
<BODY>
<A HREF="index.html">Contents</A>
<A HREF="ConfigurationLoadingOrderandPrecedence.html">Previous</A>
<A HREF="includeconfcommand.html">Next</A>
<HR NOSHADE>

<H2><A NAME="5_9">%!include command</A></H2>
<P> The <CODE>include</CODE> command is used to paste the contents of an
 external file into the source document body. It is not a config, but a
 command, and it is valid on the document Body Area.</P>
<P> The <CODE>include</CODE> command is useful to split a large document
 into smaller pieces (like chapters in a book) or to include the full
 contents of an external file into the document source. Sample:</P>
<PRE>
My first book
Dr. John Doe
1st Edition

%!include: intro.t2t
%!include: chapter1.t2t
%!include: chapter2.t2t
...
%!include: chapter9.t2t
%!include: ending.t2t
</PRE>
<P> You just inform the filename after the <CODE>%!include</CODE>
 string. The optional target specification is also supported, so this is
 valid either:</P>
<PRE>
%!include(html): file.t2t
</PRE>
<P> Note that include will insert the file Body Area into the source
 document. The included file Header and Config Areas are ignored. This
 way you can convert the included file alone or inside the main
 document.</P>
<P> But there's another three types of include:</P>
<UL>
<LI>Verbatim include</LI>
<LI>Raw include</LI>
<LI>Tagged include</LI>
</UL>
<P> The<B> Verbatim</B> type includes a text file preserving its
 original spaces and formatting, just like if the text was inside the
 txt2tags Verbatim area (```). To specify this type, enclose the
 filename with backquotes:</P>
<PRE>
%!include: ``/etc/fstab``
</PRE>
<P> The<B> Raw</B> type includes a text file as is, not trying to find
 and parse txt2tags marks on it, just like if the text was inside the
 Raw area (&quot;&quot;&quot;). To specify this type, enclose the filename with double
 quotes:</P>
<PRE>
%!include: &quot;&quot;nice_text.txt&quot;&quot;
</PRE>
<P> And the<B> Tagged</B> type is passed directly to the resulting
 document, with NO parsing or escaping performed by txt2tags. This way
 you can include additional tagged parts to your document. Useful for
 default header or footer information, or more complicated tagged code,
 unsupported by txt2tags:</P>
<PRE>
%!include(html): ''footer.html''
</PRE>
<P> Note that the filename is enclosed with single quotes. As the text
 inserted is already parsed, you should specify the target to avoid
 mistakes.</P>
 <A NAME="includeconf"></A><HR NOSHADE>
<A HREF="index.html">Contents</A>
<A HREF="ConfigurationLoadingOrderandPrecedence.html">Previous</A>
<A HREF="includeconfcommand.html">Next</A>
</BODY>
</HTML>
